﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="ControlNhapSoLieuTuNPPDKSH.ascx.cs" Inherits="UserControl_ControlNhapSoLieuTuNPPDKSH" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<%@ Register assembly="DevExpress.Web.v9.2, Version=9.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxPopupControl" tagprefix="dxpc" %>
<%@ Import Namespace="webapp4U" %>
<%@ Register Assembly="webapp4U" Namespace="webapp4U.UI" TagPrefix="webapp4U"  %>


    <script type="text/javascript" src="<%=Globals.ApplicationPath%>JScript/jquery.uploadify.js"></script>

    <script type = "text/javascript">
        function pageLoad() {

           
        $("#<%= btnDelete.ClientID %>").click(function () {
            $.blockUI({ css: {
                border: 'none',
                padding: '15px',
                backgroundColor: '#000',
                '-webkit-border-radius': '10px',
                '-moz-border-radius': '10px',
                opacity: .5,
                color: '#fff'
            }
            });
    });
    $("#<%= btnView.ClientID %>").click(function () {
        $.blockUI({ css: {
            border: 'none',
            padding: '15px',
            backgroundColor: '#000',
            '-webkit-border-radius': '10px',
            '-moz-border-radius': '10px',
            opacity: .5,
            color: '#fff'
        }
        });
});
$("#<%= btnSave.ClientID %>").click(function() {
    if ($("#<%= txtTitle.ClientID %>").val().length > 0) {
        $.blockUI({ css: {
            border: 'none',
            padding: '15px',
            backgroundColor: '#000',
            '-webkit-border-radius': '10px',
            '-moz-border-radius': '10px',
            opacity: .5,
            color: '#fff'
        }
        });
    }
});

$("#<%=FileUpload1.ClientID %>").fileUpload({
    'fileSizeLimit': '20480KB',
    'uploader': '<%=ResolveUrl("~/JScript/uploader.swf")%>',
    'cancelImg': '<%=ResolveUrl("~/Images/cancel.png")%>',
    'buttonText': 'Browse Files',
    'script': '<%=ResolveUrl("~/ASHX/Upload.ashx")%>',
    'folder': '<%=ResolveUrl("~/UserUpload/UploadTempFileExcel")%>',
    'fileDesc': 'Excel Files',
    'fileExt': '*.xls;*.xlsx',
    'multi': false,
    'auto': true,
    'onComplete': function(a, b, c, d, e) {
        if (d !== '1') {
            $('#<%= txtFileName.ClientID %>').val(d);
            $('#<%= lblFileName.ClientID %>').html(d);
            $('#<%= lblMsg.ClientID %>').html('');            
        }
    }
});
                Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler);
                function EndRequestHandler(sender, args) {
                    $.unblockUI();
                }

        }
    </script> 

<asp:UpdatePanel ID="UpdatePanel1" runat="server">
    <ContentTemplate> 
        
        <dxpc:ASPxPopupControl ID="MessageBoxExistOrder" PopupHorizontalAlign="WindowCenter"  PopupVerticalAlign="WindowCenter" Font-Bold="true" HeaderText="Xác nhận" 
            runat="server" Width="950px" Modal="true" ShowPageScrollbarWhenModal="true" ShowCloseButton="false" CloseAction="CloseButton" >                
                <ContentCollection>
                    <dxpc:PopupControlContentControl ID="PopupControlContentControl4" runat="server" SupportsDisabledAttribute="True">
                        <table width="100%">
                            <tr>
                                <td>
                                    <asp:Label ID="lblExistOrder" runat="server" Text="" Visible="false" ForeColor="Red" Font-Bold="true" Font-Italic="true"></asp:Label>                                      
                                </td>
                            </tr> 
                            <tr>
                                <td>                                   
                                    <asp:GridView ID="grvListExistOrder" AllowPaging="True" PageSize="5" OnPageIndexChanging="grvListExistOrder_PageIndexChanging" 
                                        AutoGenerateColumns="true" runat="server"  >
                                    </asp:GridView>                                    
                                </td>
                            </tr>
                            <tr>
                               <td>
                                    Bạn có muốn tiếp tục import dữ liệu vào hệ thống? Đồng ý chọn "Ok", không đồng ý chọn "Cancel".
                               </td>
                            </tr>
                            <tr>
                                <td align="center">
                                    <asp:Button ID="btnOkExistOrder" runat="server" Text="Ok" CausesValidation="false" onclick="btnOkExistOrder_Click"/>
                                    <asp:Button ID="btnCancelExistOrder" runat="server" Text="Cancel" CausesValidation="false" onclick="btnCancelExistOrder_Click"/>
                                </td>
                            </tr>                             
                        </table>                        
                    </dxpc:PopupControlContentControl>                
                </ContentCollection>
            </dxpc:ASPxPopupControl>  
        
        
        <dxpc:ASPxPopupControl ID="MessageBoxInValidData" PopupHorizontalAlign="WindowCenter"  PopupVerticalAlign="WindowCenter" Font-Bold="true" HeaderText="Xác nhận" 
            runat="server" Width="850px" Modal="true" ShowPageScrollbarWhenModal="true" CloseAction="CloseButton" >                
                <ContentCollection>
                    <dxpc:PopupControlContentControl ID="PopupControlContentControl3" runat="server" SupportsDisabledAttribute="True">
                        <table width="100%">
                            <tr>
                                <td>
                                    <asp:Label ID="lblInValidData" runat="server" Text="" Visible="false" ForeColor="Red" Font-Bold="true" Font-Italic="true"></asp:Label>                                      
                                </td>
                            </tr> 
                            <tr>
                                <td>
                                    <div style="overflow:auto; width:100%">
                                        <asp:GridView ID="grvInValidList" AllowPaging="True" PageSize="5" OnPageIndexChanging="grvInValidList_PageIndexChanging" 
                                            AutoGenerateColumns="true" runat="server"  >
                                        </asp:GridView>
                                    </div>
                                </td>
                            </tr>                            
                        </table>                        
                    </dxpc:PopupControlContentControl>                
                </ContentCollection>
            </dxpc:ASPxPopupControl>  
        
        <dxpc:ASPxPopupControl ID="MessageBoxFileDuplicate" PopupHorizontalAlign="WindowCenter"  PopupVerticalAlign="WindowCenter" Font-Bold="true" HeaderText="Xác nhận" 
            runat="server" Height="250px" Width="450px" Modal="true" ShowPageScrollbarWhenModal="true" ShowCloseButton="false" CloseAction="CloseButton" >                
                <ContentCollection>
                    <dxpc:PopupControlContentControl ID="PopupControlContentControlFileDuplicate" runat="server" SupportsDisabledAttribute="True">
                        <table width="100%">
                            <tr>
                                <td>
                                    <asp:Label ID="lblMsgDuplicateFileName" runat="server" Text="" Visible="false" ForeColor="Red" Font-Bold="true" Font-Italic="true"></asp:Label>                                      
                                </td>
                            </tr> 
                            <tr>
                               <td>
                                    <asp:Label ID="lblMsgDuplicateFile" runat="server" Visible="false" ForeColor="Red" Font-Bold="true" Font-Italic="true"></asp:Label>
                               </td>
                            </tr>
                            <tr>
                               <td>
                                    Bạn có muốn tiếp tục import dữ liệu vào hệ thống? Đồng ý chọn "Ok", không đồng ý chọn "Cancel".
                               </td>
                            </tr>
                            <tr>
                                <td align="center">
                                    <asp:Button ID="btnOk" runat="server" Text="Ok" CausesValidation="false" onclick="btnOk_Click"/>
                                    <asp:Button ID="btnCancel" runat="server" Text="Cancel" CausesValidation="false" onclick="btnCancel_Click"/>
                                </td>
                            </tr> 
                        </table>                        
                    </dxpc:PopupControlContentControl>                
                </ContentCollection>
            </dxpc:ASPxPopupControl>  
                        
        <dxpc:ASPxPopupControl ID="MessageBoxNewCustomer" PopupHorizontalAlign="WindowCenter"  PopupVerticalAlign="WindowCenter" Font-Bold="true" HeaderText="Xác nhận khách hàng mới" 
            runat="server" Width="920px" Modal="true" ShowPageScrollbarWhenModal="true" CloseAction="CloseButton" >                
                <ContentCollection>
                    <dxpc:PopupControlContentControl ID="PopupControlContentControl1" runat="server" SupportsDisabledAttribute="True">
                        <table width="100%">
                            <tr>
                                <td>
                                    <asp:Label ID="lblMessageBox" runat="server" Text=""></asp:Label>                                    
                                </td>
                            </tr> 
                            <tr>
                                <td>
                                    <asp:Button ID="btnActiveCustNewAll" runat="server" Text="Xác nhận tất cả" CausesValidation="false" onclick="btnActiveCustNewAll_Click"/>
                                    <asp:Label ID="lblMsgResultNewCust" runat="server" Visible="false" BackColor="Silver" ForeColor="Blue" Font-Bold="true" Font-Italic="true"></asp:Label>                                    
                                </td>
                            </tr> 
                            <tr>
                                <td>
                                    <asp:GridView ID="gvrNewCustList" AllowPaging="True" PageSize="5" OnPageIndexChanging="gvrNewCustList_PageIndexChanging" 
                                        OnRowCommand="gvrNewCustList_RowCommand" AutoGenerateColumns="false" runat="server"  >
                                    
                                        <Columns>
                                            <asp:TemplateField HeaderText="Stt">
                                                    <HeaderTemplate>STT</HeaderTemplate>
                                                    <ItemTemplate>
                                                        <%# Container.DataItemIndex + 1 %>                                                                
                                                    </ItemTemplate>
                                                    <HeaderStyle HorizontalAlign="Left" Width="40px" />
                                                    <ItemStyle Height="40px" HorizontalAlign="Left" Width="40px" />
                                                </asp:TemplateField>
                                                
                                                <asp:TemplateField HeaderText="Mã số">
                                                    <HeaderTemplate>Mã số</HeaderTemplate>
                                                    <ItemTemplate>                                                    
                                                        <asp:Label ID="lblMaKhachHang" runat="server" Text='<%# Eval("CustID")%>'></asp:Label>                                               
                                                    </ItemTemplate>
                                                    <HeaderStyle HorizontalAlign="Left" Width="70px" />
                                                    <ItemStyle Height="40px" HorizontalAlign="Left" Width="70px" />
                                                    
                                                </asp:TemplateField>
                                                
                                                <asp:TemplateField HeaderText="Họ tên ">
                                                    <HeaderTemplate>Họ tên</HeaderTemplate>
                                                    <ItemTemplate>
                                                        <asp:Label ID="lblCustomerNameNew" runat="server" Text='<%# Eval("customer_name")%>'></asp:Label>                                                       
                                                    </ItemTemplate>
                                                    <HeaderStyle HorizontalAlign="Left" Width="150px" />
                                                    <ItemStyle Height="40px" HorizontalAlign="Left" Width="150px" />
                                                </asp:TemplateField>
                                                
                                                <asp:TemplateField HeaderText="Địa chỉ">
                                                    <HeaderTemplate>Địa chỉ</HeaderTemplate>
                                                    <ItemTemplate>
                                                        <%# Eval("address")%>
                                                    </ItemTemplate>
                                                    <HeaderStyle HorizontalAlign="Left" Width="170px" />
                                                    <ItemStyle Height="40px" HorizontalAlign="Left" Width="170px" />                                                    
                                                </asp:TemplateField>
                                                
                                                <asp:TemplateField HeaderText="Region">
                                                    <HeaderTemplate>Region</HeaderTemplate>
                                                    <ItemTemplate>
                                                        <%# Eval("RegionDomainName")%>
                                                    </ItemTemplate>
                                                    <HeaderStyle HorizontalAlign="Left" Width="70px" />
                                                    <ItemStyle Height="40px" HorizontalAlign="Left" Width="70px" />                                                    
                                                </asp:TemplateField>
                                                
                                                <asp:TemplateField HeaderText="Region">
                                                    <HeaderTemplate>Area</HeaderTemplate>
                                                    <ItemTemplate>
                                                        <%# Eval("RegionID")%>
                                                    </ItemTemplate>
                                                    <HeaderStyle HorizontalAlign="Left" Width="70px" />
                                                    <ItemStyle Height="40px" HorizontalAlign="Left" Width="70px" />                                                    
                                                </asp:TemplateField>
                                                
                                                <asp:TemplateField HeaderText="Tỉnh/Thành">
                                                    <HeaderTemplate>Tỉnh/Thành</HeaderTemplate>
                                                    <ItemTemplate>
                                                        <%# Eval("ProvinceCode")%>
                                                    </ItemTemplate>
                                                    <HeaderStyle HorizontalAlign="Left" Width="70px" />
                                                    <ItemStyle Height="40px" HorizontalAlign="Left" Width="70px" />                                                    
                                                </asp:TemplateField>
                                                
                                                <asp:TemplateField HeaderText="Quận/Huyện">                                                
                                                    <HeaderTemplate>Quận/Huyện</HeaderTemplate>
                                                    <ItemTemplate>
                                                        <%# Eval("District")%>
                                                    </ItemTemplate>
                                                    <HeaderStyle HorizontalAlign="Left" Width="70px" />
                                                    <ItemStyle Height="40px" HorizontalAlign="Left" Width="70px" />                                                    
                                                </asp:TemplateField>
                                                
                                                <asp:TemplateField HeaderText="Channel">                                                
                                                    <HeaderTemplate>Channel</HeaderTemplate>
                                                    <ItemTemplate>
                                                        <%# Eval("ChannelName")%>
                                                    </ItemTemplate>
                                                    <HeaderStyle HorizontalAlign="Left" Width="70px" />
                                                    <ItemStyle Height="40px" HorizontalAlign="Left" Width="70px" />                                                    
                                                </asp:TemplateField>
                                                
                                                <asp:TemplateField HeaderText="Sub Channel">                                                
                                                    <HeaderTemplate>Sub Channel</HeaderTemplate>
                                                    <ItemTemplate>
                                                        <%# Eval("SubChannel")%>
                                                    </ItemTemplate>
                                                    <HeaderStyle HorizontalAlign="Left" Width="70px" />
                                                    <ItemStyle Height="40px" HorizontalAlign="Left" Width="70px" />                                                    
                                                </asp:TemplateField>
                                               
                                                <asp:TemplateField HeaderText="Nhà phân phối" Visible="true">
                                                    <HeaderTemplate>Nhà phân phối</HeaderTemplate>
                                                    <ItemTemplate>
                                                        <%# Eval("sitename")%>
                                                    </ItemTemplate>
                                                    <HeaderStyle HorizontalAlign="Left" Width="70px" />
                                                    <ItemStyle Height="40px" HorizontalAlign="Left" Width="70px" />                                                    
                                                </asp:TemplateField>
                                               
                                                <asp:TemplateField HeaderText="Sitecode" Visible="false">
                                                    <HeaderTemplate>Sitecode</HeaderTemplate>
                                                    <ItemTemplate>
                                                        <asp:Label ID="lblSitecode" runat="server" Text='<%# Eval("Sitecode")%>'></asp:Label>                                                   
                                                    </ItemTemplate>
                                                    <HeaderStyle HorizontalAlign="Left" Width="70px" />
                                                    <ItemStyle Height="40px" HorizontalAlign="Left" Width="70px" />                                                    
                                                </asp:TemplateField>
                                                
                                                <asp:TemplateField>
                                                     <ItemTemplate>
                                                        <asp:ImageButton ID="imgBtnChon" runat="server" CausesValidation="False" 
                                                        CommandName="chon" Height="25px" Width="25px" ImageUrl="~/Images/check.png" />
                                                    </ItemTemplate>
                                                    <ControlStyle BackColor="White" BorderColor="White" />
                                                    <FooterStyle BackColor="White" BorderColor="White" />
                                                    <HeaderStyle BackColor="White" BorderColor="White" />
                                                    <ItemStyle BackColor="White" BorderColor="White" />
                                                </asp:TemplateField>
                                                <asp:TemplateField>
                                                     <ItemTemplate>
                                                         <asp:LinkButton ID="lbkSelectBuyProduct" runat="server" CausesValidation="False" 
                                                        CommandName="ViewBuyProduct" Width="70">Sản phẩm đã mua</asp:LinkButton>                                                        
                                                    </ItemTemplate>
                                                    <ControlStyle BackColor="White" BorderColor="White" />
                                                    <FooterStyle BackColor="White" BorderColor="White" />
                                                    <HeaderStyle BackColor="White" BorderColor="White" />
                                                    <ItemStyle BackColor="White" BorderColor="White" />
                                                </asp:TemplateField>
                                        </Columns>
                                    </asp:GridView>
                                </td>
                            </tr>                                                       
                        </table>                        
                    </dxpc:PopupControlContentControl>                
                </ContentCollection>
            </dxpc:ASPxPopupControl>  
        
         <dxpc:ASPxPopupControl ID="MessageBoxNewProduct" PopupHorizontalAlign="WindowCenter"  PopupVerticalAlign="WindowCenter" Font-Bold="true" HeaderText="Xác nhận sản phẩm mới" 
            runat="server" Width="850px" Modal="true" ShowPageScrollbarWhenModal="true" CloseAction="CloseButton"   >                
                <ContentCollection>
                    <dxpc:PopupControlContentControl ID="PopupControlContentControl2" runat="server" SupportsDisabledAttribute="True">
                        <table width="100%">
                            <tr>
                                <td colspan="2">
                                    <asp:Label ID="lblMessageBoxNewProduct" runat="server" Text=""></asp:Label>
                                </td>
                            </tr>
                            <tr>
                                <td colspan="2" align="center">
                                    <asp:Label ID="lblMsgResultNewProduct" runat="server" Visible="false" BackColor="Silver" ForeColor="Blue" Font-Bold="true" Font-Italic="true"></asp:Label>                                    
                                </td>
                            </tr>
                           
                            <tr>
                                <td colspan="2">
                                    <asp:GridView ID="gvrNewProductList" AutoGenerateColumns="false" AllowPaging="True" PageSize="5" OnRowDataBound="gvrNewProductList_RowDataBound"
                                        OnRowCommand="gvrNewProductList_RowCommand" OnPageIndexChanging="gvrNewProductList_PageIndexChanging" runat="server"  >
                                        <Columns>
                                            <asp:TemplateField HeaderText="Stt">
                                                    <HeaderTemplate>STT</HeaderTemplate>
                                                    <ItemTemplate>
                                                        <%# Container.DataItemIndex + 1 %>                                                                
                                                    </ItemTemplate>
                                                    <HeaderStyle HorizontalAlign="Left" Width="40px" />
                                                    <ItemStyle Height="40px" HorizontalAlign="Left" Width="40px" />
                                                </asp:TemplateField>
                                                
                                                <asp:TemplateField HeaderText="Mã sản phẩm">
                                                    <HeaderTemplate> Mã sản phẩm</HeaderTemplate>
                                                    <ItemTemplate>                                                    
                                                        <asp:Label ID="lblMaHang" runat="server" Text='<%# Eval("Itemkey")%>'></asp:Label>                                               
                                                    </ItemTemplate>
                                                    <HeaderStyle HorizontalAlign="Left" Width="70px" />
                                                    <ItemStyle Height="40px" HorizontalAlign="Left" Width="70px" />
                                                    
                                                </asp:TemplateField>
                                                
                                                <asp:TemplateField HeaderText="Tên sản phẩm">
                                                    <HeaderTemplate>Tên sản phẩm</HeaderTemplate>
                                                    <ItemTemplate>
                                                        <%# Eval("Description")%>
                                                    </ItemTemplate>
                                                    <HeaderStyle HorizontalAlign="Left" Width="250px" />
                                                    <ItemStyle Height="40px" HorizontalAlign="Left" Width="250px" />
                                                </asp:TemplateField>
                                                
                                                <asp:TemplateField HeaderText="Giá">
                                                    <HeaderTemplate>Giá</HeaderTemplate>
                                                    <ItemTemplate>
                                                        <%# Eval("Price", "{0:#}")%>
                                                    </ItemTemplate>
                                                    <HeaderStyle HorizontalAlign="Left" Width="70px" />
                                                    <ItemStyle Height="40px" HorizontalAlign="Left" Width="70px" />                                                    
                                                </asp:TemplateField>
                                                
                                                <asp:TemplateField HeaderText="Nhà phân phối" Visible="true">
                                                    <HeaderTemplate>Nhà phân phối</HeaderTemplate>
                                                    <ItemTemplate>
                                                        <%# Eval("sitename")%>
                                                    </ItemTemplate>
                                                    <HeaderStyle HorizontalAlign="Left" Width="70px" />
                                                    <ItemStyle Height="40px" HorizontalAlign="Left" Width="70px" />                                                    
                                                </asp:TemplateField>
                                                
                                                <asp:TemplateField HeaderText="Sitecode" Visible="false">
                                                    <HeaderTemplate>Sitecode</HeaderTemplate>
                                                    <ItemTemplate>
                                                        <asp:Label ID="lblSitecode" runat="server" Text='<%# Eval("Sitecode")%>'></asp:Label>                                                   
                                                    </ItemTemplate>
                                                    <HeaderStyle HorizontalAlign="Left" Width="70px" />
                                                    <ItemStyle Height="40px" HorizontalAlign="Left" Width="70px" />                                                    
                                                </asp:TemplateField>
                                                
                                                <asp:TemplateField HeaderText="Group(SKU)">
                                                    <HeaderTemplate>Group(SKU)</HeaderTemplate>
                                                    <ItemTemplate>
                                                        <asp:DropDownList ID="drlNhomSanPham" AutoPostBack="true" OnSelectedIndexChanged="drlNhomSanPham_SelectedIndexChanged" runat="server" Width="100">
                                                        </asp:DropDownList>
                                                    </ItemTemplate>
                                                    <HeaderStyle HorizontalAlign="Left" Width="70px" />
                                                    <ItemStyle Height="40px" HorizontalAlign="Left" Width="70px" />                                                    
                                                </asp:TemplateField>
                                                
                                                <asp:TemplateField HeaderText="Channel(SKU)">
                                                    <HeaderTemplate>Channel(SKU)</HeaderTemplate>
                                                    <ItemTemplate>
                                                        <asp:DropDownList ID="drlKenhSanPham" runat="server" Width="100">
                                                         </asp:DropDownList>
                                                    </ItemTemplate>
                                                    <HeaderStyle HorizontalAlign="Left" Width="100px" />
                                                    <ItemStyle Height="40px" HorizontalAlign="Left" Width="100px" />                                                    
                                                </asp:TemplateField>
                                                
                                                <%--<asp:TemplateField HeaderText="Quy cách">
                                                    <HeaderTemplate>Quy cách</HeaderTemplate>
                                                    <ItemTemplate>
                                                        <asp:TextBox ID="txtQuyCach" runat="server" Width="97%" AutoPostBack="true" TabIndex="5" Text='<%# Eval("QuyCach")%>' ></asp:TextBox>
                                                        <div id="divwidthMaHangInput" style="overflow:scroll;height:150px; width:250px; display:none"></div>
                                                        <cc1:AutoCompleteExtender ID="txtQuyCach_AutoCompleteExtender" 
                                                            runat="server"
                                                            ServiceMethod="GetQuyCachProductFimex" ServicePath="~/Webservice/WebServiceDRM.asmx" 
                                                            TargetControlID="txtQuyCach"
                                                            MinimumPrefixLength="1" 
                                                            CompletionInterval="10"
                                                            EnableCaching="True"
                                                            CompletionSetCount="12"                             
                                                            CompletionListCssClass="AutoExtender"
                                                            CompletionListItemCssClass="AutoExtenderList"
                                                            CompletionListHighlightedItemCssClass="AutoExtenderHighlight"
                                                            CompletionListElementID="divwidthMaHangInput">
                                                        </cc1:AutoCompleteExtender>
                                                        
                                                    </ItemTemplate>
                                                    <HeaderStyle HorizontalAlign="Left" Width="150px" />
                                                    <ItemStyle Height="40px" HorizontalAlign="Left" Width="150px" />
                                                </asp:TemplateField>--%>
                                                
                                                <asp:TemplateField>
                                                     <ItemTemplate>
                                                        <asp:ImageButton ID="imgBtnChon" runat="server" CausesValidation="False" 
                                                        CommandName="chon" Height="25px" Width="25px" ImageUrl="~/Images/check.png" />
                                                    </ItemTemplate>
                                                    <ControlStyle BackColor="White" BorderColor="White" />
                                                    <FooterStyle BackColor="White" BorderColor="White" />
                                                    <HeaderStyle BackColor="White" BorderColor="White" />
                                                    <ItemStyle BackColor="White" BorderColor="White" />
                                                </asp:TemplateField>
                                        </Columns>
                                    </asp:GridView>
                                </td>
                            </tr>                                                       
                        </table>                        
                    </dxpc:PopupControlContentControl>                
                </ContentCollection>
            </dxpc:ASPxPopupControl>  
    
        
        <dxpc:ASPxPopupControl ID="MsgBoxCustNewBuyProductDetail" PopupHorizontalAlign="WindowCenter"  PopupVerticalAlign="WindowCenter" Font-Bold="true" HeaderText="Xác nhận sản phẩm mới" 
            runat="server" Width="750px" Modal="true" ShowPageScrollbarWhenModal="true" CloseAction="CloseButton"   >                
                <ContentCollection>
                    <dxpc:PopupControlContentControl ID="PopupControlContentControl5" runat="server" SupportsDisabledAttribute="True">
                        <table width="100%">
                            <tr>
                                <td>
                                    <input id="txtNewCustIDBuyPro" type="hidden" runat="server" />
                                    <input id="txtStieCodeNewCustBuyPro" type="hidden" runat="server" />
                                </td>
                            </tr>
                           <tr>
                                <td colspan="2">
                                    <asp:GridView ID="gvCustomerNewBuyProduct" AutoGenerateColumns="false" AllowPaging="True" PageSize="5"
                                        OnPageIndexChanging="gvCustomerNewBuyProduct_PageIndexChanging" runat="server"  >
                                        <Columns>
                                            <asp:TemplateField HeaderText="Stt">
                                                    <HeaderTemplate>STT</HeaderTemplate>
                                                    <ItemTemplate>
                                                        <%# Container.DataItemIndex + 1 %>                                                                
                                                    </ItemTemplate>
                                                    <HeaderStyle HorizontalAlign="Left" Width="40px" />
                                                    <ItemStyle Height="40px" HorizontalAlign="Left" Width="40px" />
                                                </asp:TemplateField>
                                                
                                                <asp:TemplateField HeaderText="Mã sản phẩm">
                                                    <HeaderTemplate> Mã sản phẩm</HeaderTemplate>
                                                    <ItemTemplate>                                                    
                                                        <asp:Label ID="lblMaHang" runat="server" Text='<%# Eval("Itemkey")%>'></asp:Label>                                               
                                                    </ItemTemplate>
                                                    <HeaderStyle HorizontalAlign="Left" Width="70px" />
                                                    <ItemStyle Height="40px" HorizontalAlign="Left" Width="70px" />
                                                    
                                                </asp:TemplateField>
                                                
                                                <asp:TemplateField HeaderText="Tên sản phẩm">
                                                    <HeaderTemplate>Tên sản phẩm</HeaderTemplate>
                                                    <ItemTemplate>
                                                        <%# Eval("Description")%>
                                                    </ItemTemplate>
                                                    <HeaderStyle HorizontalAlign="Left" Width="250px" />
                                                    <ItemStyle Height="40px" HorizontalAlign="Left" Width="250px" />
                                                </asp:TemplateField>
                                                                                                
                                                <asp:TemplateField HeaderText="Channel(SKU)">
                                                    <HeaderTemplate>Channel(SKU)</HeaderTemplate>
                                                    <ItemTemplate>
                                                        <%# Eval("Chanle")%>
                                                    </ItemTemplate>
                                                    <HeaderStyle HorizontalAlign="Left" Width="100px" />
                                                    <ItemStyle Height="40px" HorizontalAlign="Left" Width="100px" />                                                    
                                                </asp:TemplateField>
                                                <asp:TemplateField HeaderText="Group(SKU)">
                                                    <HeaderTemplate>Group(SKU)</HeaderTemplate>
                                                    <ItemTemplate>
                                                        <%# Eval("Group")%>
                                                    </ItemTemplate>
                                                    <HeaderStyle HorizontalAlign="Left" Width="70px" />
                                                    <ItemStyle Height="40px" HorizontalAlign="Left" Width="70px" />                                                    
                                                </asp:TemplateField>                                                
                                                
                                                <asp:TemplateField HeaderText="Nhà phân phối" Visible="true">
                                                    <HeaderTemplate>Nhà phân phối</HeaderTemplate>
                                                    <ItemTemplate>
                                                        <%# Eval("sitename")%>
                                                    </ItemTemplate>
                                                    <HeaderStyle HorizontalAlign="Left" Width="70px" />
                                                    <ItemStyle Height="40px" HorizontalAlign="Left" Width="70px" />                                                    
                                                </asp:TemplateField>
                                                
                                                <asp:TemplateField HeaderText="Sản phẩm mới" Visible="true">
                                                    <HeaderTemplate>Sản phẩm mới</HeaderTemplate>
                                                    <ItemTemplate>
                                                        <asp:CheckBox ID="chkProductNew" Enabled="false" runat="server" Checked='<%# Eval("NewProduct")%>' /> 
                                                    </ItemTemplate>
                                                    <HeaderStyle HorizontalAlign="Left" Width="40px" />
                                                    <ItemStyle Height="40px" HorizontalAlign="Left" Width="40px" />                                                    
                                                </asp:TemplateField>
                                                
                                        </Columns>
                                    </asp:GridView>
                                </td>
                            </tr>                                                       
                        </table>                        
                    </dxpc:PopupControlContentControl>                
                </ContentCollection>
            </dxpc:ASPxPopupControl>  
        
        
        
        
     <div class="direct_container_right_titletop">
                    Cập nhật số liệu từ NPP DKSH.
                </div>
            <cc1:TabContainer ID="TabContainer1" runat="server" ActiveTabIndex="0" 
            BackColor="#CCFFFF" Font-Names="Arial" 
            Width="100%" Height="1200">
            <cc1:TabPanel ID="TabPanel1" runat="server" HeaderText="Thông tin upload số liệu của nhà cung cấp" TabIndex="0">
                 <ContentTemplate>
                     <!-- Content main-->
                <div class="direct_container_main">
                    <div class="direct_container_form_right">
                        <table border="0" width="100%">
                        
                            <tr>
                                <td colspan="4" align="center">
                                    <asp:Label ID="lblMsg" runat="server" Visible="false" BackColor="Silver" ForeColor="Blue" Font-Bold="true" Font-Italic="true"></asp:Label>
                                </td>
                            </tr>
                            <tr>
                                <td width="14%" align="right"><p class="direct_label">Tiêu đề: </p></td>
                                <td width="86%" align="left">                               
                                    <asp:TextBox ID="txtTitle" runat="server"></asp:TextBox>
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" Display="Dynamic" ControlToValidate="txtTitle" ErrorMessage="Tiêu đề không được rỗng"></asp:RequiredFieldValidator>
                                </td>
                            </tr>                           
                            <tr>
                                <td width="14%" align="right"><p class="direct_label">Upload File</p></td>
                                <td width="86%" align="left">                               
                                       
                                    <asp:FileUpload ID="FileUpload1" runat="server" />
                                       
                                </td>
                            </tr>                    
                            
                             <tr>
                                <td align="right"><p class="direct_label">Tên file</p></td>
                                <td align="left">
                                    <asp:HiddenField ID="txtFileName" runat="server" />
                                    <asp:Label ID="lblFileName" runat="server" Text=""></asp:Label>
                                    <asp:HiddenField ID="txtfileNameDestination" runat="server" /> 
                                    <asp:HiddenField ID="txtfileNameDestinationInsert" runat="server" />                                    
                                </td>
                            </tr>
                            <tr>
                                <td align="right"><p class="direct_label"></p></td>
                                <td align="left">
                                    <asp:Button ID="btnDelete" runat="server" Text="Xóa file" CausesValidation="false" onclick="btnDelete_Click"/>
                                    <asp:Button ID="btnView" runat="server" Text="Xem dữ liệu" CausesValidation="false" onclick="btnView_Click"/>
                                    <asp:Button ID="btnSave" runat="server" Text="Import dữ liệu" CausesValidation="true" onclick="btnSave_Click"/>                                    
                                    <asp:LinkButton ID="lbtShowCustNew" runat="server" OnClick="lbtShowCustNew_Click" CausesValidation="false" Font-Underline="true">Bạn có khách hàng mới</asp:LinkButton>
                                    
                                    <asp:LinkButton ID="lbtShowProductNew" runat="server" OnClick="lbtShowProductNew_Click" CausesValidation="false" Font-Underline="true">Bạn có sản phẩm mới</asp:LinkButton>                                    
                                </td>
                            </tr>
                            <tr>
                            
                            </tr>
                        </table>
                        
                        <div style="overflow:auto; width:100%">
                            <asp:GridView ID="gviewList" runat="server">
                            </asp:GridView>
                        </div>
                       <div align="center">
                        <asp:Panel ID="DisplayPager" Visible="True" runat="server">
                            <div align="center">
                                <table cellpadding="2" cellspacing="0" border="0" width="100%" align="center">
                                    <tr>
                                        <td valign="middle" align="center">
                                            <webapp4U:Pager ID="Pager" runat="server" CausesValidation="false" />
                                        </td>
                                    </tr>
                                </table>
                            </div>
                        </asp:Panel>
                    </div> 
                    </div>
                </div>
                
                <!-- EndContent main-->
                 </ContentTemplate>
            </cc1:TabPanel>             
            </cc1:TabContainer>   
            
                          
    </ContentTemplate>
</asp:UpdatePanel>
